package dk.fuddi.conversion;

import dk.fuddi.exception.EnDecodeException;
import org.apache.commons.lang.StringEscapeUtils;

/**
 * @author fuddi
 */
public class CsvUtils implements DeEncodeInterface {

  private String name = "CSV";

  public String encode(String csv) throws EnDecodeException {
    System.out.println("CsvUtils.encode");
    return StringEscapeUtils.escapeCsv(csv);
  }

  public String decode(String csv) throws EnDecodeException {
    System.out.println("CsvUtils.decode");
    return StringEscapeUtils.unescapeCsv(csv);
  }

  @Override
  public String toString() {
    return name;
  }
}
